#include<bits/stdc++.h>

using namespace std;
const int maxn = 100 + 20;
typedef long long ll;
ll m, n, p, q;

//O(nlogn)
int main() {
    cin >> m;
    for (p = 1; p <= m; p++) {//f(q)=p+..+q; ���㵥���ԡ���[p+1,m]
        ll left = p + 1, right = m;
        while (left <= right) {
            q = (left + right) / 2;
            ll s = (q - p + 1) * (p + q) / 2;
            if (s == m) {
                cout << p << " " << q << endl;
                break;
            } else if (s > m) {
                right = q - 1;
            } else {
                left = q + 1;
            }
        }
    }
}

